ARDK for Android/com.nianticlabs.ardk.utils/ImageMath/reprojection
reprojection
[androidJvm]
fun reprojection(aspect: Float, fovRadians: Float, zNear: Float, zFar: Float, referenceView: FloatArray, targetView: FloatArray, backProjectionDistance: Float = 0.9f): Matrix
Returns a 3×3 homography matrix (android.graphics.Matrix) that reprojects image coordinates from a reference camera view into a target camera view.
This is typically used to transform 2D image-space coordinates (normalized in 0..1) from one camera perspective to another, e.g. for aligning visual overlays between AR frames.
Return
A 3×3 homography matrix represented as an android.graphics.Matrix.
Parameters
androidJvm
| aspect | The image aspect ratio (width / height). |
| fovRadians | The vertical field of view in radians. |
| zNear | The near clipping plane distance. |
| zFar | The far clipping plane distance. |
| referenceView | The reference camera's 4×4 view matrix as a FloatArray (length 16), in OpenGL-style column-major order. This can typically be acquired from ARCore using camera.getViewMatrix(viewMatrix, 0). |
| targetView | The target camera's 4×4 view matrix, same format and origin as referenceView. |
| backProjectionDistance | Non-linear depth at which to reproject (between zNear and zFar). A value of 0.0 corresponds to the near plane, 1.0 to the far plane. Recommended value: 0.9. |